How do I iterate through and append the data from multiple pages with an API request